﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System;
using System.Collections;

namespace _121_GF订阅事件和执行
{
    class EventComponent
    {
        public event EventHandler Handle;
        private Dictionary<int, EventHandler> m_EventHandlers;

        public EventComponent()
        {
            m_EventHandlers = new Dictionary<int, EventHandler>();

        }

        public void Subscribe(int id, EventHandler h)
        {
            //根据id来区分事件


        }

        public void Unsubscribe(int id, EventHandler h)
        {
            //根据id来区分事件


        }

        public void Fire(object sender, GameEventArgs e)
        {
            if (Handle != null)
            {
                Handle.Invoke(sender, e);
            }

        }
    }
}
